Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2/4] Supermicro redfish methods #370

Merged
merged 17 commits into from
Nov 29, 2023
Merged

Conversation

joelrebel
Copy link
Member

What does this PR implement/change/remove?

  • Implements the Inventory, PowerStateGet, PowerSet methods for the Supermicro provider using the redfishwrapper package.

Checklist

  • Tests added
  • Similar commits squashed

@joelrebel joelrebel changed the title Supermicro redfish methods [2/4] Supermicro redfish methods Nov 27, 2023
Comment on lines +192 to +207
func (c *Client) PowerStateGet(ctx context.Context) (state string, err error) {
if c.serviceClient == nil || c.serviceClient.redfish == nil {
return "", errors.Wrap(bmclibErrs.ErrLoginFailed, "client not initialized")
}

return c.serviceClient.redfish.SystemPowerStatus(ctx)
}

// PowerSet sets the power state of a server
func (c *Client) PowerSet(ctx context.Context, state string) (ok bool, err error) {
if c.serviceClient == nil || c.serviceClient.redfish == nil {
return false, errors.Wrap(bmclibErrs.ErrLoginFailed, "client not initialized")
}

return c.serviceClient.redfish.PowerSet(ctx, state)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the state for these methods be a constant with a specific type, something like PowerState?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep thats the plan, although since this will affect all providers and it changes the interface, it needs to be done separately

[3/4] redfish/GetBiosConfiguration: move tests and fixtures
@joelrebel joelrebel merged commit ee0f228 into redfishwrapper-methods Nov 29, 2023
5 checks passed
@joelrebel joelrebel deleted the smc-redfish-fixes branch November 29, 2023 07:43
@joelrebel joelrebel mentioned this pull request Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants